home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / biblio / bibtex / contrib / bstfiles.zoo / kluwer.bst < prev    next >
Text File  |  1992-03-02  |  23KB  |  1,228 lines

  1. % BibTeX standard bibliography style `kluwer' (one of the harvard family)
  2.     % version 0.99a for BibTeX versions 0.99a or later, LaTeX version 2.09.
  3.     % Copyright (C) 1991, all rights reserved.
  4.     % Copying of this file is authorized only if either
  5.     % (1) you make absolutely no changes to your copy, including name, or
  6.     % (2) if you do make changes, you name it something other than
  7.     % btxbst.doc, plain.bst, unsrt.bst, alpha.bst, abbrv.bst, agsm.bst,
  8.         % dcu.bst or kluwer.bst.
  9.     % This restriction helps ensure that all standard styles are identical.
  10.     % The file harvard.tex has the documentation for this style.
  11.  
  12. % ACKNOWLEDGEMENT:
  13. %   This document is a modified version of alpha.bst to which it owes much of
  14. %   its functionality.
  15.  
  16. % AUTHOR
  17. %   Peter Williams, Key Centre for Design Quality, Sydney University
  18. %   e-mail: peterw@archsci.arch.su.oz.au
  19.  
  20. ENTRY
  21.   { address
  22.     author
  23.     booktitle
  24.     chapter
  25.     edition
  26.     editor
  27.     howpublished
  28.     institution
  29.     journal
  30.     key
  31.     month
  32.     note
  33.     number
  34.     organization
  35.     pages
  36.     publisher
  37.     school
  38.     series
  39.     title
  40.     type
  41.     volume
  42.     year
  43.   }
  44.   { field.used }
  45.   { extra.label sort.label list.year }
  46.  
  47. INTEGERS { output.state before.all mid.sentence after.sentence after.block }
  48.  
  49. FUNCTION {init.state.consts}
  50. { #0 'before.all :=
  51.   #1 'mid.sentence :=
  52.   #2 'after.sentence :=
  53.   #3 'after.block :=
  54. }
  55.  
  56. STRINGS { s t f }
  57.  
  58. FUNCTION {output.nonnull}
  59. { 's :=
  60.   output.state mid.sentence =
  61.     { ", " * write$ }
  62.     { output.state after.block =
  63.     { add.period$ write$
  64.       newline$
  65.       "\newblock " write$
  66.     }
  67.     { output.state before.all =
  68.         'write$
  69.         { add.period$ " " * write$ }
  70.       if$
  71.     }
  72.       if$
  73.       mid.sentence 'output.state :=
  74.     }
  75.   if$
  76.   s
  77. }
  78.  
  79. FUNCTION {output}
  80. { duplicate$ empty$
  81.     'pop$
  82.     'output.nonnull
  83.   if$
  84. }
  85.  
  86. FUNCTION {output.check}
  87. { 't :=
  88.   duplicate$ empty$
  89.     { pop$ "empty " t * " in " * cite$ * warning$ }
  90.     'output.nonnull
  91.   if$
  92. }
  93.  
  94. FUNCTION {item.check}
  95. { 't :=
  96.   empty$
  97.     { "empty " t * " in " * cite$ * warning$ }
  98.     { skip$ }
  99.   if$
  100. }
  101.  
  102. FUNCTION {fin.entry}
  103. { add.period$
  104.   write$
  105.   newline$
  106. }
  107.  
  108. FUNCTION {new.block}
  109. { output.state before.all =
  110.     'skip$
  111.     { after.block 'output.state := }
  112.   if$
  113. }
  114.  
  115. FUNCTION {not}
  116. {   { #0 }
  117.     { #1 }
  118.   if$
  119. }
  120.  
  121. FUNCTION {and}
  122. {   'skip$
  123.     { pop$ #0 }
  124.   if$
  125. }
  126.  
  127. FUNCTION {or}
  128. {   { pop$ #1 }
  129.     'skip$
  130.   if$
  131. }
  132.  
  133. FUNCTION {field.or.null}
  134. { duplicate$ empty$
  135.     { pop$ "" }
  136.     'skip$
  137.   if$
  138. }
  139.  
  140. FUNCTION {emphasize}
  141. { duplicate$ empty$
  142.     { pop$ "" }
  143.     { "{\em " swap$ * "}" * }
  144.   if$
  145. }
  146.  
  147. FUNCTION {embolden}
  148. { duplicate$ empty$
  149.     { pop$ "" }
  150.     { "{\bf " swap$ * "}" * }
  151.   if$
  152. }
  153.  
  154. FUNCTION {quote}
  155. { duplicate$ empty$
  156.     { pop$ "" }
  157.     { "`" swap$ * "'" * }
  158.   if$
  159. }
  160.  
  161. INTEGERS { nameptr namesleft numnames }
  162.  
  163. FUNCTION {format.names}
  164. { 's :=
  165.   'f :=
  166.   #1 'nameptr :=
  167.   s num.names$ 'numnames :=
  168.   numnames 'namesleft :=
  169.     { namesleft #0 > }
  170.     { s nameptr f format.name$ 't :=
  171.       nameptr #1 >
  172.     { namesleft #1 >
  173.         { ", " * t * }
  174.         { t "others" =
  175.         { " et~al." * }
  176.         { " and " * t * }
  177.           if$
  178.         }
  179.       if$
  180.     }
  181.     't
  182.       if$
  183.       nameptr #1 + 'nameptr :=
  184.       namesleft #1 - 'namesleft :=
  185.     }
  186.   while$
  187. }
  188.  
  189. FUNCTION {format.authors}
  190. { author empty$
  191.     { "" }
  192.     { "{vv~}{ll}{, jj}{, f.}" author format.names }
  193.   if$
  194. }
  195.  
  196. FUNCTION {format.editors}
  197. { editor empty$
  198.     { "" }
  199.     { "{vv~}{ll}{, jj}{, f.}" editor format.names
  200.       editor num.names$ #1 >
  201.     { " (eds)" * }
  202.     { " (ed.)" * }
  203.       if$
  204.     }
  205.   if$
  206. }
  207.  
  208. FUNCTION {format.editors.reverse}
  209. { editor empty$
  210.     { "" }
  211.     { "{f.~}{vv~}{ll}{, jj}" editor format.names
  212.       editor num.names$ #1 >
  213.     { " (eds)" * }
  214.     { " (ed.)" * }
  215.       if$
  216.     }
  217.   if$
  218. }
  219.  
  220. FUNCTION {format.title}
  221. { title empty$
  222.     { "" }
  223.     { title "t" change.case$ }
  224.   if$
  225. }
  226.  
  227. FUNCTION {n.dashify}
  228. { 't :=
  229.   ""
  230.     { t empty$ not }
  231.     { t #1 #1 substring$ "-" =
  232.     { t #1 #2 substring$ "--" = not
  233.         { "--" *
  234.           t #2 global.max$ substring$ 't :=
  235.         }
  236.         {   { t #1 #1 substring$ "-" = }
  237.         { "-" *
  238.           t #2 global.max$ substring$ 't :=
  239.         }
  240.           while$
  241.         }
  242.       if$
  243.     }
  244.     { t #1 #1 substring$ *
  245.       t #2 global.max$ substring$ 't :=
  246.     }
  247.       if$
  248.     }
  249.   while$
  250. }
  251.  
  252. FUNCTION {format.btitle}
  253. { title emphasize
  254. }
  255.  
  256. FUNCTION {tie.or.space.connect}
  257. { duplicate$ text.length$ #3 <
  258.     { "~" }
  259.     { " " }
  260.   if$
  261.   swap$ * *
  262. }
  263.  
  264. FUNCTION {either.or.check}
  265. { empty$
  266.     'pop$
  267.     { "can't use both " swap$ * " fields in " * cite$ * warning$ }
  268.   if$
  269. }
  270.  
  271. FUNCTION {format.bvolume}
  272. { volume empty$
  273.     { "" }
  274.     { "Vol." volume tie.or.space.connect
  275.       series empty$
  276.     'skip$
  277.     { " of " * series emphasize * }
  278.       if$
  279.       "volume and number" number either.or.check
  280.     }
  281.   if$
  282. }
  283.  
  284. FUNCTION {format.number.series}
  285. { volume empty$
  286.     { number empty$
  287.     { series field.or.null }
  288.     { output.state mid.sentence =
  289.         { "number" }
  290.         { "Number" }
  291.       if$
  292.       number tie.or.space.connect
  293.       series empty$
  294.         { "there's a number but no series in " cite$ * warning$ }
  295.         { " in " * series emphasize * }
  296.       if$
  297.     }
  298.       if$
  299.     }
  300.     { "" }
  301.   if$
  302. }
  303.  
  304. FUNCTION {format.edition}
  305. { edition empty$
  306.     { "" }
  307.     { output.state mid.sentence =
  308.     { edition "l" change.case$ " edn" * }
  309.     { edition "t" change.case$ " edn" * }
  310.       if$
  311.     }
  312.   if$
  313. }
  314.  
  315. INTEGERS { multiresult }
  316.  
  317. FUNCTION {multi.page.check}
  318. { 't :=
  319.   #0 'multiresult :=
  320.     { multiresult not
  321.       t empty$ not
  322.       and
  323.     }
  324.     { t #1 #1 substring$
  325.       duplicate$ "-" =
  326.       swap$ duplicate$ "," =
  327.       swap$ "+" =
  328.       or or
  329.     { #1 'multiresult := }
  330.     { t #2 global.max$ substring$ 't := }
  331.       if$
  332.     }
  333.   while$
  334.   multiresult
  335. }
  336.  
  337. FUNCTION {format.pages}
  338. { pages empty$
  339.     { "" }
  340.     { pages multi.page.check
  341.     { "pp.~" pages n.dashify * }
  342.     { "p.~" pages * }
  343.       if$
  344.     }
  345.   if$
  346. }
  347.  
  348. FUNCTION {format.vol.num.pages}
  349. { volume embolden field.or.null
  350.   number empty$
  351.     'skip$
  352.     { "(" number * ")" * *
  353.       volume empty$
  354.     { "there's a number but no volume in " cite$ * warning$ }
  355.     'skip$
  356.       if$
  357.     }
  358.   if$
  359.   pages empty$
  360.     'skip$
  361.     { duplicate$ empty$
  362.     { pop$ format.pages }
  363.     { ",~" * pages n.dashify * }
  364.       if$
  365.     }
  366.   if$
  367. }
  368.  
  369. FUNCTION {format.chapter.pages}
  370. { chapter empty$
  371.     'format.pages
  372.     { type empty$
  373.     { "chapter" }
  374.     { type "l" change.case$ }
  375.       if$
  376.       chapter tie.or.space.connect
  377.       pages empty$
  378.     'skip$
  379.     { ", " * format.pages * }
  380.       if$
  381.     }
  382.   if$
  383. }
  384.  
  385. FUNCTION {format.in.ed.booktitle}
  386. { booktitle empty$
  387.     { "" }
  388.     { editor empty$
  389.     { booktitle emphasize }
  390.     { "{\em in} " format.editors.reverse * ", " * booktitle emphasize * }
  391.       if$
  392.     }
  393.   if$
  394. }
  395.  
  396. FUNCTION {empty.misc.check}
  397. { author empty$ title empty$ howpublished empty$
  398.   month empty$ year empty$ note empty$
  399.   and and and and and
  400.   key empty$ not and
  401.     { "all relevant fields are empty in " cite$ * warning$ }
  402.     'skip$
  403.   if$
  404. }
  405.  
  406. FUNCTION {format.thesis.type}
  407. { type empty$
  408.     'skip$
  409.     { pop$
  410.       type "t" change.case$
  411.     }
  412.   if$
  413. }
  414.  
  415. FUNCTION {format.tr.number}
  416. { type empty$
  417.     { "Technical Report" }
  418.     'type
  419.   if$
  420.   number empty$
  421.     { "t" change.case$ }
  422.     { number tie.or.space.connect }
  423.   if$
  424. }
  425.  
  426. FUNCTION {format.article.crossref}
  427. { key empty$
  428.     { journal empty$
  429.     { "need key or journal for " cite$ * " to crossref " * crossref *
  430.       warning$
  431.       ""
  432.     }
  433.     { "in {\em " journal * "\/}" * " \cite{" * crossref * "}" *
  434.         }
  435.       if$
  436.     }
  437.     { " {\em in} \citeasnoun{" crossref * "}" * }
  438.   if$
  439. }
  440.  
  441. FUNCTION {format.book.crossref}
  442. { volume empty$
  443.     { "empty volume in " cite$ * "'s crossref of " * crossref * warning$
  444.       "in "
  445.     }
  446.     { "Vol." volume tie.or.space.connect
  447.       " of " *
  448.     }
  449.   if$
  450.   editor empty$
  451.   editor field.or.null author field.or.null =
  452.   or
  453.     { key empty$
  454.     { series empty$
  455.         { "need editor, key, or series for " cite$ * " to crossref " *
  456.           crossref * warning$
  457.           "" *
  458.         }
  459.         { "{\em " * series * "\/}" * " \cite{" * crossref * "}" *}
  460.       if$
  461.     }
  462.     { " \citeasnoun{" * crossref * "}" * }
  463.       if$
  464.     }
  465.     { " \citeasnoun{" * crossref * "}" * }
  466.   if$
  467. }
  468.  
  469. FUNCTION {format.incoll.inproc.crossref}
  470. { editor empty$
  471.   editor field.or.null author field.or.null =
  472.   or
  473.     {
  474.       key empty$
  475.     { booktitle empty$
  476.         { "need editor, key, or booktitle for " cite$ * " to crossref " *
  477.           crossref * warning$
  478.           ""
  479.         }
  480.         { "in {\em " booktitle * "\/}" * " \cite{" * crossref * "}" *}
  481.       if$
  482.     }
  483.     { " {\em in} \citeasnoun{" crossref * "}" * }
  484.       if$
  485.     }
  486.     {  " {\em in} \citeasnoun{" crossref * "}" * }
  487.   if$
  488. }
  489.  
  490. INTEGERS { len }
  491.  
  492. FUNCTION {chop.word}
  493. { 's :=
  494.   'len :=
  495.   s #1 len substring$ =
  496.     { s len #1 + global.max$ substring$ }
  497.     's
  498.   if$
  499. }
  500.  
  501. FUNCTION {format.lab.names.abbr}
  502. { 's :=
  503.   s num.names$ 'numnames :=
  504.   numnames #1 >
  505.     { numnames #2 >
  506.     { s #1 "{vv~}{ll}" format.name$ " et al." * }
  507.     { s #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" =
  508.             { s #1 "{vv~}{ll}" format.name$ " et al." * }
  509.         { s #1 "{vv~}{ll}" format.name$ " and " *
  510.               s #2 "{vv~}{ll}" format.name$ * 
  511.             }
  512.           if$
  513.         }
  514.       if$
  515.     }
  516.     { s #1 "{vv~}{ll}" format.name$ }
  517.   if$
  518. }
  519.  
  520. FUNCTION {format.lab.names.full}
  521. { 's :=
  522.   #1 'nameptr :=
  523.   s num.names$ 'numnames :=
  524.   numnames 'namesleft :=
  525.     { namesleft #0 > }
  526.     { s nameptr "{vv~}{ll}" format.name$ 't :=
  527.       nameptr #1 >
  528.     { namesleft #1 >
  529.         { ", " * t * }
  530.         { t "others" =
  531.         { " et~al." * }
  532.         { " and " * t * }
  533.           if$
  534.         }
  535.       if$
  536.     }
  537.     't
  538.       if$
  539.       nameptr #1 + 'nameptr :=
  540.       namesleft #1 - 'namesleft :=
  541.     }
  542.   while$
  543. }
  544.  
  545. INTEGERS { author.field editor.field organization.field title.field key.field }
  546.  
  547. FUNCTION {init.field.constants}
  548. { #0 'author.field :=
  549.   #1 'editor.field :=
  550.   #2 'organization.field :=
  551.   #3 'title.field :=
  552.   #4 'key.field :=
  553. }
  554.  
  555. FUNCTION {make.list.label}
  556. { author.field field.used =
  557.     { format.authors }
  558.     { editor.field field.used =
  559.         { format.editors }
  560.         { organization.field field.used =
  561.             { "The " #4 organization chop.word #3 text.prefix$ }
  562.             { title.field field.used =
  563.                 { format.btitle }
  564.                 { key.field field.used =
  565.                     { key #3 text.prefix$ }
  566.                     { "Internal error :001 on " cite$ * " label" * warning$ }
  567.                   if$
  568.                 }
  569.               if$
  570.             }
  571.           if$
  572.         }
  573.       if$
  574.     }
  575.   if$
  576. }
  577.  
  578. FUNCTION {make.full.label}
  579. { author.field field.used =
  580.     { author format.lab.names.full }
  581.     { editor.field field.used =
  582.         { editor format.lab.names.full }
  583.         { organization.field field.used =
  584.             { "The " #4 organization chop.word #3 text.prefix$ }
  585.             { title.field field.used =
  586.                 { format.btitle }
  587.                 { key.field field.used =
  588.                     { key #3 text.prefix$ }
  589.                     { "Internal error :001 on " cite$ * " label" * warning$ }
  590.                   if$
  591.                 }
  592.               if$
  593.             }
  594.           if$
  595.         }
  596.       if$
  597.     }
  598.   if$
  599. }
  600.  
  601. FUNCTION {make.abbr.label}
  602. { author.field field.used =
  603.     { author format.lab.names.abbr }
  604.     { editor.field field.used =
  605.         { editor format.lab.names.abbr }
  606.         { organization.field field.used =
  607.             { "The " #4 organization chop.word #3 text.prefix$ }
  608.             { title.field field.used =
  609.                 { format.btitle }
  610.                 { key.field field.used =
  611.                     { key #3 text.prefix$ }
  612.                     { "Internal error :001 on " cite$ * " label" * warning$ }
  613.                   if$
  614.                 }
  615.               if$
  616.             }
  617.           if$
  618.         }
  619.       if$
  620.     }
  621.   if$
  622. }
  623.  
  624. FUNCTION {output.bibitem}
  625. { newline$
  626.   "\harvarditem[" write$
  627.   make.abbr.label write$
  628.   "]{" write$
  629.   make.full.label write$
  630.   "}{" write$
  631.   list.year write$
  632.   "}{" write$
  633.   cite$ write$
  634.   "}" write$
  635.   newline$
  636.   ""
  637.   before.all 'output.state :=
  638. }
  639.  
  640. FUNCTION {list.label.output}
  641. { make.list.label write$
  642. }
  643.  
  644. FUNCTION {article}
  645. { output.bibitem
  646.   list.label.output
  647.   ": " list.year * output.nonnull
  648.   author "author" item.check
  649.   title.field field.used =
  650.     { skip$ }
  651.     { format.title "title" output.check }
  652.   if$
  653.   crossref missing$
  654.     { journal emphasize "journal" duplicate$ item.check
  655.       pages empty$
  656.         {
  657.           output
  658.         }
  659.         {
  660.           " " *
  661.           format.vol.num.pages * output
  662.         }
  663.       if$
  664.     }
  665.     { format.article.crossref output.nonnull
  666.       format.pages output
  667.     }
  668.   if$
  669.   new.block
  670.   note output
  671.   fin.entry
  672. }
  673.  
  674. FUNCTION {book}
  675. { output.bibitem
  676.   list.label.output
  677.   ": " list.year * output.nonnull
  678.   author empty$
  679.     { editor "author and editor" item.check }
  680.     { crossref missing$
  681.     { "author and editor" editor either.or.check }
  682.     'skip$
  683.       if$
  684.     }
  685.   if$
  686.   title.field field.used =
  687.     { skip$ }
  688.     { format.btitle "title" output.check }
  689.   if$
  690.   crossref missing$
  691.     { format.bvolume output
  692.       format.number.series output
  693.       format.edition output
  694.       publisher "publisher" output.check
  695.       address output
  696.     }
  697.     { format.book.crossref output.nonnull
  698.       format.edition output
  699.     }
  700.   if$
  701.   new.block
  702.   note output
  703.   fin.entry
  704. }
  705.  
  706. FUNCTION {booklet}
  707. { output.bibitem
  708.   list.label.output
  709.   ": " list.year * output.nonnull
  710.   title.field field.used =
  711.     { skip$ }
  712.     { format.title "title" output.check }
  713.   if$
  714.   howpublished output
  715.   address output
  716.   new.block
  717.   note output
  718.   fin.entry
  719. }
  720.  
  721. FUNCTION {inbook}
  722. { output.bibitem
  723.   list.label.output
  724.   ": " list.year * output.nonnull
  725.   author empty$
  726.     { editor "author and editor" item.check }
  727.     { crossref missing$
  728.     { "author and editor" editor either.or.check }
  729.     'skip$
  730.       if$
  731.     }
  732.   if$
  733.   title.field field.used =
  734.     { skip$ }
  735.     { format.btitle "title" output.check }
  736.   if$
  737.   crossref missing$
  738.     { format.bvolume output
  739.       format.number.series output
  740.       format.edition output
  741.       publisher "publisher" output.check
  742.       address output
  743.     }
  744.     { format.book.crossref output.nonnull
  745.       format.edition output
  746.     }
  747.   if$
  748.   format.chapter.pages "chapter and pages" output.check
  749.   new.block
  750.   note output
  751.   fin.entry
  752. }
  753.  
  754. FUNCTION {incollection}
  755. { output.bibitem
  756.   list.label.output
  757.   ": " list.year * output.nonnull
  758.   title.field field.used =
  759.     { skip$ }
  760.     { format.title "title" output.check }
  761.   if$
  762.   author "author" item.check
  763.   crossref missing$
  764.     { format.in.ed.booktitle "booktitle" output.check
  765.       format.edition output
  766.       format.bvolume output
  767.       format.number.series output
  768.       publisher "publisher" output.check
  769.       address output
  770.     }
  771.     { format.incoll.inproc.crossref output.nonnull
  772.     }
  773.   if$
  774.   format.chapter.pages output
  775.   new.block
  776.   note output
  777.   fin.entry
  778. }
  779.  
  780. FUNCTION {inproceedings}
  781. { output.bibitem
  782.   list.label.output
  783.   ": " list.year * output.nonnull
  784.   title.field field.used =
  785.     { skip$ }
  786.     { format.title "title" output.check }
  787.   if$
  788.   author "author" item.check
  789.   crossref missing$
  790.     { format.in.ed.booktitle "booktitle" output.check
  791.       format.bvolume output
  792.       format.number.series output
  793.       address empty$
  794.     { organization output
  795.       publisher output
  796.     }
  797.     { organization output
  798.       publisher output
  799.       address output.nonnull
  800.     }
  801.       if$
  802.     }
  803.     { format.incoll.inproc.crossref output.nonnull
  804.     }
  805.   if$
  806.   format.pages output
  807.   new.block
  808.   note output
  809.   fin.entry
  810. }
  811.  
  812. FUNCTION {conference} { inproceedings }
  813.  
  814. FUNCTION {manual}
  815. { output.bibitem
  816.   list.label.output
  817.   ": " list.year * output.nonnull
  818.   title.field field.used =
  819.     { skip$ }
  820.     { format.btitle "title" output.check }
  821.   if$
  822.   format.edition output
  823.   author empty$
  824.     { organization empty$
  825.     { address output
  826.     }
  827.     'skip$
  828.       if$
  829.     }
  830.     { organization output
  831.       address output
  832.     }
  833.   if$
  834.   new.block
  835.   note output
  836.   fin.entry
  837. }
  838.  
  839. FUNCTION {mastersthesis}
  840. { output.bibitem
  841.   list.label.output
  842.   ": " list.year * output.nonnull
  843.   author "author" item.check
  844.   title.field field.used =
  845.     { skip$ }
  846.     { format.title emphasize "title" output.check }
  847.   if$
  848.   "Master's thesis" format.thesis.type output.nonnull
  849.   school "school" output.check
  850.   address output
  851.   new.block
  852.   note output
  853.   fin.entry
  854. }
  855.  
  856. FUNCTION {misc}
  857. { output.bibitem
  858.   list.label.output
  859.   ": " list.year * output.nonnull
  860.   title.field field.used =
  861.     { skip$ }
  862.     { format.title output }
  863.   if$
  864.   howpublished output
  865.   new.block
  866.   note output
  867.   fin.entry
  868.   empty.misc.check
  869. }
  870.  
  871. FUNCTION {phdthesis}
  872. { output.bibitem
  873.   list.label.output
  874.   ": " list.year * output.nonnull
  875.   author "author" item.check
  876.   title.field field.used =
  877.     { skip$ }
  878.     { format.btitle "title" output.check }
  879.   if$
  880.   "PhD thesis" format.thesis.type output.nonnull
  881.   school "school" output.check
  882.   address output
  883.   new.block
  884.   note output
  885.   fin.entry
  886. }
  887.  
  888. FUNCTION {proceedings}
  889. { output.bibitem
  890.   list.label.output
  891.   ": " list.year * output.nonnull
  892.   title.field field.used =
  893.     { skip$ }
  894.     { format.btitle "title" output.check }
  895.   if$
  896.   format.bvolume output
  897.   format.number.series output
  898.   address empty$
  899.     { editor empty$
  900.     { skip$ }
  901.     { organization output
  902.     }
  903.       if$
  904.       publisher output
  905.     }
  906.     { editor empty$
  907.     'skip$
  908.     { organization output }
  909.       if$
  910.       publisher output
  911.       address output.nonnull
  912.     }
  913.   if$
  914.   new.block
  915.   note output
  916.   fin.entry
  917. }
  918.  
  919. FUNCTION {techreport}
  920. { output.bibitem
  921.   list.label.output
  922.   ": " list.year * output.nonnull
  923.   author "author" item.check
  924.   title.field field.used =
  925.     { skip$ }
  926.     { format.title "title" output.check }
  927.   if$
  928.   format.tr.number emphasize output.nonnull
  929.   institution "institution" output.check
  930.   address output
  931.   new.block
  932.   note output
  933.   fin.entry
  934. }
  935.  
  936. FUNCTION {unpublished}
  937. { output.bibitem
  938.   list.label.output
  939.   ": " list.year * output.nonnull
  940.   author "author" item.check
  941.   title.field field.used =
  942.     { skip$ }
  943.     { format.title "title" output.check }
  944.   if$
  945.   note "note" output.check
  946.   fin.entry
  947. }
  948.  
  949. FUNCTION {default.type} { misc }
  950.  
  951. MACRO {jan} {"January"}
  952.  
  953. MACRO {feb} {"February"}
  954.  
  955. MACRO {mar} {"March"}
  956.  
  957. MACRO {apr} {"April"}
  958.  
  959. MACRO {may} {"May"}
  960.  
  961. MACRO {jun} {"June"}
  962.  
  963. MACRO {jul} {"July"}
  964.  
  965. MACRO {aug} {"August"}
  966.  
  967. MACRO {sep} {"September"}
  968.  
  969. MACRO {oct} {"October"}
  970.  
  971. MACRO {nov} {"November"}
  972.  
  973. MACRO {dec} {"December"}
  974.  
  975. MACRO {acmcs} {"ACM Computing Surveys"}
  976.  
  977. MACRO {acta} {"Acta Informatica"}
  978.  
  979. MACRO {cacm} {"Communications of the ACM"}
  980.  
  981. MACRO {ibmjrd} {"IBM Journal of Research and Development"}
  982.  
  983. MACRO {ibmsj} {"IBM Systems Journal"}
  984.  
  985. MACRO {ieeese} {"IEEE Transactions on Software Engineering"}
  986.  
  987. MACRO {ieeetc} {"IEEE Transactions on Computers"}
  988.  
  989. MACRO {ieeetcad}
  990.  {"IEEE Transactions on Computer-Aided Design of Integrated Circuits"}
  991.  
  992. MACRO {ipl} {"Information Processing Letters"}
  993.  
  994. MACRO {jacm} {"Journal of the ACM"}
  995.  
  996. MACRO {jcss} {"Journal of Computer and System Sciences"}
  997.  
  998. MACRO {scp} {"Science of Computer Programming"}
  999.  
  1000. MACRO {sicomp} {"SIAM Journal on Computing"}
  1001.  
  1002. MACRO {tocs} {"ACM Transactions on Computer Systems"}
  1003.  
  1004. MACRO {tods} {"ACM Transactions on Database Systems"}
  1005.  
  1006. MACRO {tog} {"ACM Transactions on Graphics"}
  1007.  
  1008. MACRO {toms} {"ACM Transactions on Mathematical Software"}
  1009.  
  1010. MACRO {toois} {"ACM Transactions on Office Information Systems"}
  1011.  
  1012. MACRO {toplas} {"ACM Transactions on Programming Languages and Systems"}
  1013.  
  1014. MACRO {tcs} {"Theoretical Computer Science"}
  1015.  
  1016. READ
  1017.  
  1018. EXECUTE {init.field.constants}
  1019.  
  1020. FUNCTION {sortify}
  1021. { purify$
  1022.   "l" change.case$
  1023. }
  1024.  
  1025. FUNCTION {author.key.label}
  1026. { author empty$
  1027.     { key empty$
  1028.     { title.field 'field.used := }
  1029.     { key.field 'field.used := }
  1030.       if$
  1031.     }
  1032.     { author.field 'field.used := }
  1033.   if$
  1034. }
  1035.  
  1036. FUNCTION {author.editor.key.label}
  1037. { author empty$
  1038.     { editor empty$
  1039.     { key empty$
  1040.         { title.field 'field.used := }
  1041.         { key.field 'field.used := }
  1042.       if$
  1043.       }
  1044.     { editor.field 'field.used := }
  1045.       if$
  1046.     }
  1047.     { author.field 'field.used := }
  1048.   if$
  1049. }
  1050.  
  1051. FUNCTION {author.key.organization.label}
  1052. { author empty$
  1053.     { key empty$
  1054.     { organization empty$
  1055.         { title.field 'field.used := }
  1056.         { organization.field 'field.used := }
  1057.       if$
  1058.     }
  1059.     { key.field 'field.used := }
  1060.       if$
  1061.     }
  1062.     { author.field 'field.used := }
  1063.   if$
  1064. }
  1065.  
  1066. FUNCTION {editor.key.organization.label}
  1067. { editor empty$
  1068.     { key empty$
  1069.     { organization empty$
  1070.         { title.field 'field.used := }
  1071.         { organization.field 'field.used := }
  1072.       if$
  1073.     }
  1074.     { key.field 'field.used := }
  1075.       if$
  1076.     }
  1077.     { editor.field 'field.used := }
  1078.   if$
  1079. }
  1080.  
  1081. FUNCTION {sort.format.title}
  1082. { 't :=
  1083.   "A " #2
  1084.     "An " #3
  1085.       "The " #4 t chop.word
  1086.     chop.word
  1087.   chop.word
  1088.   sortify
  1089.   #1 global.max$ substring$
  1090. }
  1091.  
  1092. FUNCTION {calc.label}
  1093. { type$ "book" =
  1094.   type$ "inbook" =
  1095.   or
  1096.     'author.editor.key.label
  1097.     { type$ "proceedings" =
  1098.     'editor.key.organization.label
  1099.     { type$ "manual" =
  1100.         'author.key.organization.label
  1101.         'author.key.label
  1102.       if$
  1103.     }
  1104.       if$
  1105.     }
  1106.   if$
  1107.   make.abbr.label
  1108.   title.field field.used =
  1109.     { sort.format.title }
  1110.     { sortify }
  1111.   if$
  1112.   year field.or.null purify$ #-1 #4 substring$ sortify
  1113.   *
  1114.   'sort.label :=
  1115. }
  1116.  
  1117. FUNCTION {first.presort}
  1118. { calc.label
  1119.   sort.label
  1120.   title.field field.used =
  1121.     { skip$ }
  1122.     { "    "
  1123.       *
  1124.       make.list.label sortify
  1125.       *
  1126.       "    "
  1127.       *
  1128.       title field.or.null
  1129.       sort.format.title
  1130.       *
  1131.     }
  1132.   if$
  1133.   #1 entry.max$ substring$
  1134.   'sort.key$ :=
  1135. }
  1136.  
  1137. ITERATE {first.presort}
  1138.  
  1139. SORT
  1140.  
  1141. STRINGS { last.sort.label next.extra }
  1142.  
  1143. INTEGERS { last.extra.num }
  1144.  
  1145. FUNCTION {initialize.last.extra.num}
  1146. { #0 int.to.chr$ 'last.sort.label :=
  1147.   "" 'next.extra :=
  1148.   #0 'last.extra.num :=
  1149. }
  1150.  
  1151. FUNCTION {forward.pass}
  1152. { last.sort.label sort.label =
  1153.     { last.extra.num #1 + 'last.extra.num :=
  1154.       last.extra.num int.to.chr$ 'extra.label :=
  1155.     }
  1156.     { "a" chr.to.int$ 'last.extra.num :=
  1157.       "" 'extra.label :=
  1158.       sort.label 'last.sort.label :=
  1159.     }
  1160.   if$
  1161. }
  1162.  
  1163. FUNCTION {reverse.pass}
  1164. { next.extra "b" =
  1165.     { "a" 'extra.label := }
  1166.     'skip$
  1167.   if$
  1168.   year empty$
  1169.     { "n.d." extra.label * 'list.year := }
  1170.     { year extra.label * 'list.year := }
  1171.   if$
  1172.   extra.label 'next.extra :=
  1173. }
  1174.  
  1175. EXECUTE {initialize.last.extra.num}
  1176.  
  1177. ITERATE {forward.pass}
  1178.  
  1179. REVERSE {reverse.pass}
  1180.  
  1181. FUNCTION {second.presort}
  1182. { make.list.label
  1183.   title.field field.used =
  1184.     { sort.format.title }
  1185.     { sortify }
  1186.   if$
  1187.   "    "
  1188.   *
  1189.   list.year field.or.null sortify
  1190.   *
  1191.   "    "
  1192.   *
  1193.   title.field field.used =
  1194.     { skip$ }
  1195.     { title field.or.null
  1196.       sort.format.title
  1197.       *
  1198.     }
  1199.   if$
  1200.   #1 entry.max$ substring$
  1201.   'sort.key$ :=
  1202. }
  1203.  
  1204. ITERATE {second.presort}
  1205.  
  1206. SORT
  1207.  
  1208. FUNCTION {begin.bib}
  1209. { preamble$ empty$
  1210.     'skip$
  1211.     { preamble$ write$ newline$ }
  1212.   if$
  1213.   "\begin{thebibliography}{xx}" write$ newline$
  1214. }
  1215.  
  1216. EXECUTE {begin.bib}
  1217.  
  1218. EXECUTE {init.state.consts}
  1219.  
  1220. ITERATE {call.type$}
  1221.  
  1222. FUNCTION {end.bib}
  1223. { newline$
  1224.   "\end{thebibliography}" write$ newline$
  1225. }
  1226.  
  1227. EXECUTE {end.bib}
  1228.